package org.cmcc.pcap.packet.udp;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.pcap4j.packet.IpPacket;
import org.pcap4j.packet.UdpPacket;

/**
 * 
 * @author Amish
 * @date 2018年12月24日 下午3:49:08
 *
 */
public class UdpProducer implements Runnable {
	public static Logger logger = LogManager.getLogger(UdpProducer.class);
	UdpPacket udpPacket;
	UdpConnectionCache udpConnectionCache;
	IpPacket ipPacket;
	
	public UdpProducer(IpPacket udpPacket , UdpConnectionCache udpConnectionCache){
		this.udpPacket = udpPacket.get(UdpPacket.class);
		this.udpConnectionCache = udpConnectionCache;
		this.ipPacket = udpPacket;
	}

	@Override
	public void run() {
		this.udpConnectionCache.addUDPPacket(this.ipPacket);
	}

}
